package com.gzx.plugin.data.wxjk.sync.dao;

import com.gzx.plugin.data.wxjk.sync.pojo.Ddzwxx;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DdzwxxDao {

    @Insert("<script>" +
            "INSERT INTO data_wxjk_ddzwxx (" +
            "    business_id, " +
            "    cust_code, " +
            "    cust_name, " +
            "    overdue_amount, " +
            "    current_penalty, " +
            "    paid_amount, " +
            "    over_period, " +
            "    principal, " +
            "    interest, " +
            "    pre_clear_loan_amount, " +
            "    create_time" +
            ") VALUES " +
            "<foreach collection='list' item='item' separator=','>" +
            "    (" +
            "        #{item.businessId}, " +
            "        #{item.custCode}, " +
            "        #{item.custName}, " +
            "        #{item.overdueAmount}, " +
            "        #{item.currentPenalty}, " +
            "        #{item.paidAmount}, " +
            "        #{item.overPeriod}, " +
            "        #{item.principal}, " +
            "        #{item.interest}, " +
            "        #{item.preClearLoanAmount}, " +
            "        NOW()" +
            "    )" +
            "</foreach>" +
            "</script>")
    void batchSave(@Param("list") List<Ddzwxx> list);
}
